package com.example.post.mapper;

import com.example.post.model.Blog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Optional;

@Mapper
public interface BlogMapper {
    Optional<Blog> findById(int id);
    List<Blog> findAllByTitleContaining(String title);
    void save(Blog blog);
    List<Blog> findAll();
    void deleteById(int id);
    List<Blog> findAllByUserId(int userId);

    void updateContentById(@Param("id") int id, @Param("content") String content);




    int findCount();

}
